import axios from "./http.js";
import _ from "lodash";

/**
 *
 * 主播信息，包括招募和运营
 */

// 提交第一步
export function addActorStep1(data, config) {
  let url = "/cs/anchor/submit1";

  data = data || {};
  config = _.merge({ headers: { isLogin: false } }, config || {});
  return axios.post(url, data, config);
}
// 提交第二部
export function addActorStep2(data, config) {
  let url = "/cs/anchor/submit2";

  data = data || {};
  config = _.merge({ headers: { isLogin: false } }, config || {});
  return axios.post(url, data, config);
}

// 浏览次数统计
export function visit(data, config) {
  const url = "/cs/anchor/visit";
  data = data || {};
  config = _.merge({ headers: { isLogin: false } }, config || {});
  return axios.post(url, data, config);
}

// 上传视频
export function uploadVideo(data, config) {
  let url = "/bs/upload";

  data = data || {};
  config = _.merge(
    { headers: { isLogin: false, "Content-Type": "multipart/form-data" } },
    config || {}
  );
  return axios.post(url, data, config);
}

// 获取才艺列表
export function getSkillList(config) {
  let url = "/bs/skill/list";
  const opts = _.merge({ headers: { isLogin: false } }, config || {});

  return axios.get(url, opts);
}

// 获取才艺列表
export function getPlatfomDocList(config) {
  let url = "/bs/platform/h5/listByChannelId";
  const opts = _.merge({ headers: { isLogin: false } }, config || {});

  return axios.get(url, opts);
}
